
#include <rtthread.h>
#include <U8g2lib.h>
#include "SelectionList_page.h"
#include "user_func.h"
extern "C" {
#include <encode.h>
#include "decode.h"
    extern void cpu_usage_get(rt_uint8_t *major, rt_uint8_t *minor);
}

rt_event_t general_event = RT_NULL;
#define SHOW_SELECT 1

/*
  U8g2lib Example Overview:
    Frame Buffer Examples: clearBuffer/sendBuffer. Fast, but may not work with all Arduino boards because of RAM consumption
    Page Buffer Examples: firstPage/nextPage. Less RAM usage, should work with all Arduino boards.
    U8x8 Text Only Example: No RAM usage, direct communication with display controller. No graphics, 8x8 Text only.

*/

// You may reference Drivers/drv_gpio.c for pinout
// In u8x8.h #define U8X8_USE_PINS
#define U8G2_PIN_UP                         U8X8_PIN_NONE                  // PA3
#define U8G2_PIN_DOWN                       U8X8_PIN_NONE                 // PA4
#define U8G2_PIN_LEFT                       U8X8_PIN_NONE//GET_PIN(B,4)                   // PA6
#define U8G2_PIN_RIGHT                      GET_PIN(B,3)                    // PB8
#define U8G2_PIN_SELECT                     GET_PIN(B,5)        // PB5
#define U8G2_PIN_HOME                       U8X8_PIN_NONE       // PB1

#define OLED_SPI_PIN_CLK                    GET_PIN(A,5)  // PA5
#define OLED_SPI_PIN_MOSI                   GET_PIN(A,6)  // PA7
#define OLED_SPI_PIN_RES                    GET_PIN(A,4)  // PA2
#define OLED_SPI_PIN_DC                     GET_PIN(A,7)  // PA1
#define OLED_SPI_PIN_CS                     0  // PA0

static U8G2_SSD1306_128X64_NONAME_F_4W_SW_SPI u8g2(U8G2_R0, \
        /* clock=*/ OLED_SPI_PIN_CLK, \
        /* data=*/ OLED_SPI_PIN_MOSI, \
        /* cs=*/ OLED_SPI_PIN_CS, \
        /* dc=*/ OLED_SPI_PIN_DC, \
        /* reset=*/ OLED_SPI_PIN_RES);


struct menu_entry_type
{
    const uint8_t *font;
    uint16_t icon;
    const char *name;
};

struct menu_state
{
    int16_t menu_start;           /* in pixel */
    int16_t frame_position;       /* in pixel */
    uint8_t position;             /* position, array index */
};

/*
  Icon configuration
  Width and height must match the icon font size
  GAP: Space between the icons
  BGAP: Gap between the display border and the cursor.
*/
#define ICON_WIDTH  16
#define ICON_HEIGHT 16
#define ICON_GAP    4
#define ICON_BGAP   16
#define ICON_Y 32+ ICON_GAP
#define ICON_Y_SIGNAL u8g2.getDisplayHeight() - 5
#define TITLE_HEIGHT 14         //状态栏高度
static struct menu_state current_state = { ICON_BGAP, ICON_BGAP, 0 };
static struct menu_state destination_state = { ICON_BGAP, ICON_BGAP, 0 };

static void transfer_test_page();
/*
    247: WI-FI
    253: 4G
*/
static struct menu_entry_type signal_list[] =
{
    { u8g2_font_open_iconic_all_2x_t, 253, "4G"},
    { u8g2_font_open_iconic_all_2x_t, 247, "WIFI"},
    { u8g2_font_open_iconic_all_2x_t, 197, "OFFLINE"},
    { NULL, 0, NULL }

};

static void draw_signal(struct menu_state *state)       //画信号
{
    int16_t x;
    x = state->menu_start;
    if (gDevice_info.device_status == DEVICE_OFFLINE)
    {
        if (x >= -ICON_WIDTH && x < u8g2.getDisplayWidth())
        {
            u8g2.setFont(signal_list[2].font);
            u8g2.drawGlyph(x, ICON_Y_SIGNAL, signal_list[2].icon);
        }
        x += ICON_WIDTH + ICON_GAP;
        return ;
    }
    if ((gDevice_info.device_status & DEVICE_ONLINE_ONLY_4G) == DEVICE_ONLINE_ONLY_4G)
    {
        if (x >= -ICON_WIDTH && x < u8g2.getDisplayWidth())
        {
            u8g2.setFont(signal_list[0].font);
            u8g2.drawGlyph(x, ICON_Y_SIGNAL, signal_list[0].icon);
        }
        x += ICON_WIDTH + ICON_GAP;
    }
    if ((gDevice_info.device_status & DEVICE_ONLINE_ONLY_WIFI) == DEVICE_ONLINE_ONLY_WIFI)
    {
        if (x >= -ICON_WIDTH && x < u8g2.getDisplayWidth())
        {
            u8g2.setFont(signal_list[1].font);
            u8g2.drawGlyph(x, ICON_Y_SIGNAL, signal_list[1].icon);
        }
        x += ICON_WIDTH + ICON_GAP;
    }

}
/*
    247: WI-FI
    253: 4G
*/
static struct menu_entry_type menu_entry_list[] =
{

//    { u8g2_font_open_iconic_all_2x_t, 203, "open  lock"},
    { u8g2_font_open_iconic_all_2x_t, 253, "4G info"},
    { u8g2_font_open_iconic_all_2x_t, 247, "wifi info"},
    { u8g2_font_open_iconic_all_2x_t, 129, "setting"},
    { NULL, 0, NULL }

};

static void draw(struct menu_state *state)
{
    int16_t x;
    uint8_t i;
    x = state->menu_start;
    i = 0;
    while (menu_entry_list[i].icon > 0)
    {
        if (x >= -ICON_WIDTH && x < u8g2.getDisplayWidth())
        {
            u8g2.setFont(menu_entry_list[i].font);
            u8g2.drawGlyph(x, ICON_Y, menu_entry_list[i].icon);
        }
        i++;
        x += ICON_WIDTH + ICON_GAP;
    }
    u8g2.drawFrame(state->frame_position - 1, ICON_Y - ICON_HEIGHT - 1, ICON_WIDTH + 2, ICON_WIDTH + 2);
    u8g2.drawFrame(state->frame_position - 2, ICON_Y - ICON_HEIGHT - 2, ICON_WIDTH + 4, ICON_WIDTH + 4);
    u8g2.drawFrame(state->frame_position - 3, ICON_Y - ICON_HEIGHT - 3, ICON_WIDTH + 6, ICON_WIDTH + 6);
}

//滚屏显示字符串
void drawStr_Scrollable(u8g2_uint_t x, u8g2_uint_t y, const char *s, u8g2_uint_t limit_width)
{
    if (u8g2.getStrWidth(s) > limit_width)
    {
        static uint8_t offset = 0, cont = 0;
        cont++;
//      rt_kprintf("getStrWidth %d, getDisplayWidth %d\n",u8g2.getStrWidth(s),limit_width);
        u8g2.drawStr(x, y, &s[offset]);
        if (cont >= 10)
        {
            cont = 0;
            offset++;
            if (u8g2.getStrWidth(&s[offset]) < (limit_width))       //留有一个空格的空间，防止显示不全
            {
                offset = 0;
            }

        }
    }
    else
    {
        u8g2.drawStr(x, y, s);
    }
}

rt_err_t recv_titel_show_menu()
{
    uint32_t e;
    static uint8_t cont = 0;
    if (RT_EOK == rt_event_recv(general_event, SHOW_SELECT, RT_EVENT_FLAG_OR | RT_EVENT_FLAG_CLEAR, rt_tick_from_millisecond(1), &e))
    {
        cont = 10;
        return RT_EOK;
    }
    else if (cont > 0)
    {
        cont--;
        return RT_EOK;

    }
    return RT_ERROR;
}
void send_titel_show_menu()
{
    rt_event_send(general_event, SHOW_SELECT);
}
#define MENU_ITEMS 6
char *menu_strings[MENU_ITEMS] = { "NB IOT info", "4G info", "WIFI info", "More", "Setting", "System"};
static void draw_title(uint16_t start_x)
{
    u8g2.drawLine(0, TITLE_HEIGHT, 128, TITLE_HEIGHT);
    u8g2.setFont(u8g2_font_helvB08_tr);

    if (RT_EOK == recv_titel_show_menu())
    {
        u8g2.drawStr(
            (u8g2.getDisplayWidth() - u8g2.getStrWidth(menu_entry_list[destination_state.position].name)) / 2,
            12,
            menu_strings[destination_state.position]
            //menu_entry_list[destination_state.position].name
        );
        return ;
    }
    char data_buf[50];
    int pos = 0;
    tm t = get_time();
    pos += sprintf(&data_buf[pos], "%d:%d ", t.tm_hour, t.tm_min);

    if (gDevice_info.device_status == DEVICE_OFFLINE)
        pos += sprintf(&data_buf[pos], "OFFLINE ");
    else
        pos += sprintf(&data_buf[pos], "ONLINE");

    sprintf(&data_buf[pos], "RSSI: %d  %1d.%01dV  %1d.%01dA  Bat: %d%%", gDevice_info.signal_val, gDevice_info.vol / 1000, gDevice_info.vol % 1000, gDevice_info.elec / 1000, gDevice_info.elec % 1000, gDevice_info.bat);
		drawStr_Scrollable(start_x, 12, data_buf, u8g2.getDisplayWidth()-start_x);        //超出就使用滚屏显示

}
void print_device_status()
{
    char data_buf[15];
    if (gDevice_info.device_status == DEVICE_OFFLINE)
        sprintf(data_buf, "OFFLINE");
    else
        sprintf(data_buf, "ONLINE");
    //sprintf(data_buf, "signal: %d", gDevice_info.signal_val);
    u8g2.print(data_buf);
}
static void to_begin(struct menu_state *state)          //设置为初始状态
{
    state->menu_start = ICON_BGAP;
    state->frame_position = ICON_BGAP;
    state->position = 0;
    send_titel_show_menu();
}
static void to_right(struct menu_state *state)
{
    if (menu_entry_list[state->position + 1].font != NULL)
    {
        if ((int16_t)state->frame_position + 2 * (int16_t)ICON_WIDTH + (int16_t)ICON_BGAP < (int16_t)u8g2.getDisplayWidth())
        {
            state->position++;
            state->frame_position += ICON_WIDTH + (int16_t)ICON_GAP;
        }
        else
        {
            state->position++;
            state->frame_position = (int16_t)u8g2.getDisplayWidth() - (int16_t)ICON_WIDTH - (int16_t)ICON_BGAP;
            state->menu_start = state->frame_position - state->position * ((int16_t)ICON_WIDTH + (int16_t)ICON_GAP);
        }
        send_titel_show_menu();

    }
}

static void to_left(struct menu_state *state)
{
    if (state->position > 0)
    {
        if ((int16_t)state->frame_position >= (int16_t)ICON_BGAP + (int16_t)ICON_WIDTH + (int16_t)ICON_GAP)
        {
            state->position--;
            state->frame_position -= ICON_WIDTH + (int16_t)ICON_GAP;
        }
        else
        {
            state->position--;
            state->frame_position = ICON_BGAP;
            state->menu_start = state->frame_position - state->position * ((int16_t)ICON_WIDTH + (int16_t)ICON_GAP);
        }
        send_titel_show_menu();
    }
}

static uint8_t towards_int16(int16_t *current, int16_t dest)
{
    if (*current < dest)
    {
        (*current)++;
        return 1;
    }
    else if (*current > dest)
    {
        (*current)--;
        return 1;
    }
    return 0;
}

static uint8_t towards(struct menu_state *current, struct menu_state *destination)
{
    uint8_t r = 0;
    r |= towards_int16(&(current->frame_position), destination->frame_position);
    r |= towards_int16(&(current->frame_position), destination->frame_position);
    r |= towards_int16(&(current->menu_start), destination->menu_start);
    r |= towards_int16(&(current->menu_start), destination->menu_start);
    return r;
}


#define THREAD_PRIORITY         25
#define THREAD_STACK_SIZE       4086
#define THREAD_TIMESLICE        5
static rt_thread_t tid1 = RT_NULL;

void draw_menu(int x, int y, uint8_t current)
{
#define SHOW_LIST_MAX 4     //菜单最多显示4行，超过的会滚动显示
    uint8_t i, h;
    u8g2_uint_t w, d, e;
    u8g2.setFont(u8g2_font_helvB08_tr);
    h = u8g2.getAscent() - u8g2.getDescent(); //读取基线上方的字形的参考高度（上升） - 读取基线（下降）下方的字形的参考高度
    w = u8g2.getDisplayWidth();             //读取屏幕的宽度
    char **menu_str = menu_strings;
    //rt_kprintf("current: %d\n",current);
    if (current >= SHOW_LIST_MAX)
    {
        menu_str += (current - (SHOW_LIST_MAX - 1));
    }
    for (i = 0; i < SHOW_LIST_MAX; i++)
    {
        u8g2.setDrawColor(1);
        if (i == current)
        {
            u8g2.drawBox(0, (i) * h + y, w, h + 2); //绘制一个实心矩形（左上边缘的X位置，左上边缘的Y位置，w框的宽度，h盒子的高度）
            u8g2.setDrawColor(0);               //指定给当前颜色索引
        }
        else if (current >= SHOW_LIST_MAX && (i == SHOW_LIST_MAX - 1))  //i==SHOW_LIST_MAX-1防止前三个反色
        {
            u8g2.drawBox(0, (SHOW_LIST_MAX - 1) * h + y, w, h + 2); //绘制一个实心矩形（左上边缘的X位置，左上边缘的Y位置，w框的宽度，h盒子的高度）
            u8g2.setDrawColor(0);               //指定给当前颜色索引
        }


        d = (w - u8g2.getUTF8Width(menu_str[i])) / 2;       //居中显示
        u8g2.drawStr(d, (i + 1) * h + y, menu_str[i]);
    }
    u8g2.setDrawColor(1);
}
void drawSignal(U8G2 u8g2, uint8_t strength)
{
		if(strength<=0){
			u8g2.drawStr(1, 12, " ...");
			return ;
		}
    for (uint8_t i = 0; i < strength; i++)
    {
        u8g2.drawVLine(1 + i * 2, 8 - i, i+2);
    }
}
void draw_home(uint8_t current)
{
	  uint8_t counter=6;			//TODO  信号值
		drawSignal(u8g2, counter % 7);
    draw_title(15);                       //状态栏
    draw_menu(0, TITLE_HEIGHT, current);          //选择菜单
}
uint8_t menu_event_handle(int8_t event)
{
    static uint8_t current;
    if (event == U8X8_MSG_GPIO_MENU_NEXT)           //按下右键
    {
        current++;
        current %= MENU_ITEMS;
    }
    if (event == U8X8_MSG_GPIO_MENU_SELECT)
    {
        switch (current)
        {
        case 0:
            nbiot_info_page(RT_NULL);
            break;
        case 1:
            sim_info_page(RT_NULL);
            break;
        case 2:
            wifi_info_page(RT_NULL);
            break;
        case 3:
            more_page(RT_NULL);
            break;
        case 4:
            setting_page(RT_NULL);
            break;
        case 5:
            system_page(RT_NULL);
            break;
        default:
            u8g2.userInterfaceMessage(
                "wait develop...",
                "",
                "",
                " ok ");
            break;
        }
    }
    return current;

}
void drawTime(tm* t)
{
    u8g2.setFont(u8g2_font_6x12_tr);
		char buff[10];
		sprintf(buff,"%d:%d",t->tm_hour,t->tm_min);
    u8g2.drawStr(15, 41, buff);
}

//在线u8g2模拟 https://p3dt.net/u8g2sim/
static void u8g2_icon_menu_entry(void *parameter)
{
    u8g2.begin(/*Select=*/ U8G2_PIN_SELECT, /*Right/Next=*/ U8G2_PIN_RIGHT, /*Left/Prev=*/ U8G2_PIN_LEFT, /*Up=*/ U8G2_PIN_UP, /*Down=*/ U8G2_PIN_DOWN, /*Home/Cancel=*/ U8G2_PIN_HOME);
    u8g2.setFont(u8g2_font_6x12_tr);
    u8g2.setContrast(128);
    uint8_t menu_current = 0;       //当前菜单选择

		while (1)
    {
        int8_t event;
        do
        {
            u8g2.clearBuffer();
						//tm t;
						//drawTime(&t);   
						
            draw_home(menu_current);
            u8g2.sendBuffer();

            rt_thread_mdelay(10);
            event = u8g2.getMenuEvent();
            menu_current = menu_event_handle(event);

//           menu_entry_list[0].icon++;
//           rt_kprintf("icon: %d\n",menu_entry_list[0].icon);
        }
        while (towards(&current_state, &destination_state));
    }
}

static void test_page()
{
    char data_buf[40];
    int8_t event;
    int8_t event_deal = 0;
    static int test_count = 0;
    int res;
    int total_count = 0;
    int ok_count = 0;
    for (;;)
    {
        u8g2.firstPage();
        do
        {
            event = u8g2.getMenuEvent();

#define WAIT 0
#define OPEN 1
#define CLOSE 2
#define CMD_OK 3
#define CMD_FAILD 4
#define CMD_COUNT 5
#define WAIT_ONLINE 6
            if (event == U8X8_MSG_GPIO_MENU_NEXT)
            {
                event_deal = OPEN;
            }
            else if (event == U8X8_MSG_GPIO_MENU_PREV)
            {
                total_count = 0;
                ok_count = 0;
            }
            else if (event == U8X8_MSG_GPIO_MENU_SELECT)
            {
                return ;
            }

            switch (event_deal)
            {
            case OPEN:
                res = wp_open_lock();
                if (res == WP_CMD_OK)
                {

                    u8g2.drawStr(1, 60, "CMD:OK");
                    event_deal = CMD_OK;
                }
                else if (res == WP_CMD_FAIL)
                {
                    u8g2.drawStr(1, 60, "CMD:FAIL");
                    event_deal = CMD_FAILD;
                }
                else if (res == WP_CMD_DEALING)
                {
                    u8g2.drawStr(1, 60, "CMD:DEALING");
                }
                else if (res == WP_CMD_IDLE)
                {
                    u8g2.drawStr(1, 60, "CMD:CMD_IDLE");
                }
                break;
            case CLOSE:
                res = wp_close_lock();
                if (res == WP_CMD_OK)
                {

                    u8g2.drawStr(1, 60, "CMD:OK");
                    event_deal = CMD_OK;
                }
                else if (res == WP_CMD_FAIL)
                {
                    u8g2.drawStr(1, 60, "CMD:FAIL");
                    event_deal = CMD_FAILD;
                }
                else if (res == WP_CMD_DEALING)
                {
                    u8g2.drawStr(1, 60, "CMD:DEALING");
                }
                else if (res == WP_CMD_IDLE)
                {
                    u8g2.drawStr(1, 60, "CMD:CMD_IDLE");
                }
                break;
            case CMD_OK:
                u8g2.drawStr(1, 60, "CMD:OK");
                rt_thread_delay(1000);
                event_deal = CMD_COUNT;
                ok_count++;
                break;
            case CMD_FAILD:
                u8g2.drawStr(1, 60, "CMD:FAIL");
                rt_thread_delay(1000);
                event_deal = CMD_COUNT;
                break;
            case CMD_COUNT:
                total_count++;
                static int togle = 0;
                if (togle == 0)
                {
                    togle = 1;
                    event_deal = CLOSE;
                }
                else
                {
                    togle = 0;
                    event_deal = OPEN;
                }
                rt_kprintf("open count successd/total %d/%d \n", ok_count, total_count);
                break;
            }
            sprintf(data_buf, "C:%d/%d", ok_count, total_count);
            u8g2.drawStr(80, 60, data_buf);
        }
        while (u8g2.nextPage());
        // transfer internal memory to the display
//      u8g2.setFont(u8g2_font_open_iconic_all_4x_t);
//      u8g2.drawGlyph(50, 50, i );
//      u8g2.sendBuffer();
        //  wp_open_lock();
        rt_thread_delay(100);
    }


}

static void open_lock_page(void)
{
    char data_buf[40];
    int8_t event;
    int8_t event_deal = 0;
    static int test_count = 0;
    int res;
    for (;;)
    {
        u8g2.firstPage();
        do
        {
            // clear the internal memory
            u8g2.setFont(u8g2_font_6x13_tr);            // choose a suitable font
            //gDevice_info();

            if (gDevice_info.device_status == DEVICE_ONLINE)
            {
                sprintf(data_buf, "S:ONLINE  Vol:%1d.%01dV", gDevice_info.vol / 1000, gDevice_info.vol % 1000);
                u8g2.drawStr(1, 18, data_buf);
            }
            else
            {
                sprintf(data_buf, "S:OFFLINE Vol:%1d.%01dV", gDevice_info.vol / 1000, gDevice_info.vol % 1000);
                u8g2.drawStr(1, 18, data_buf);
            }
            if (gDevice_info.motor_status == STATUS_MOTOR_STOP_V)
            {
                u8g2.drawStr(1, 40, "Motor:STOP");
            }
            else if (gDevice_info.motor_status == STATUS_MOTOR_LEFT_V)
            {
                u8g2.drawStr(1, 40, "Motor:LEFT");
            }
            else if (gDevice_info.motor_status == STATUS_MOTOR_RIGHT_V)
            {
                u8g2.drawStr(1, 40, "Motor:RIGHT");
            }
            if (gDevice_info.limit_status == STATUS_NO_LIMIT_V)
            {
                u8g2.drawStr(80, 40, "Limit:NO");
            }
            else if (gDevice_info.limit_status == STATUS_LEFT_LIMIT_V)
            {
                u8g2.drawStr(80, 40, "Limit:LT");
            }
            else if (gDevice_info.limit_status == STATUS_RIGHT_LIMIT_V)
            {
                u8g2.drawStr(80, 40, "Limit:RT");
            }
            else
            {
                u8g2.drawStr(80, 40, "Limit:-");
            }

            event = u8g2.getMenuEvent();

#define WAIT 0
#define OPEN 1
#define CLOSE 2
#define CMD_OK 3
#define CMD_FAILD 4
            if (event == U8X8_MSG_GPIO_MENU_NEXT)
            {
                event_deal = OPEN;
            }
            else if (event == U8X8_MSG_GPIO_MENU_PREV)
            {
                event_deal = CLOSE;
            }
            else if (event == U8X8_MSG_GPIO_MENU_SELECT)
            {
                return ;
            }
            //rt_kprintf("event:%d deal %d \n",event,event_deal);
            switch (event_deal)
            {
            case OPEN:
                res = wp_open_lock();
                if (res == WP_CMD_OK)
                {

                    u8g2.drawStr(1, 60, "CMD:OK");
                    event_deal = CMD_OK;
                }
                else if (res == WP_CMD_FAIL)
                {
                    u8g2.drawStr(1, 60, "CMD:FAIL");
                    event_deal = CMD_FAILD;
                }
                else if (res == WP_CMD_DEALING)
                {
                    u8g2.drawStr(1, 60, "CMD:DEALING");
                }
                else if (res == WP_CMD_IDLE)
                {
                    u8g2.drawStr(1, 60, "CMD:CMD_IDLE");
                }
                break;
            case CLOSE:
                res = wp_close_lock();
                if (res == WP_CMD_OK)
                {

                    u8g2.drawStr(1, 60, "CMD:OK");
                    event_deal = CMD_OK;
                }
                else if (res == WP_CMD_FAIL)
                {
                    u8g2.drawStr(1, 60, "CMD:FAIL");
                    event_deal = CMD_FAILD;
                }
                else if (res == WP_CMD_DEALING)
                {
                    u8g2.drawStr(1, 60, "CMD:DEALING");
                }
                else if (res == WP_CMD_IDLE)
                {
                    u8g2.drawStr(1, 60, "CMD:CMD_IDLE");
                }
                break;
            case CMD_OK:
                u8g2.drawStr(1, 60, "CMD:OK");
                break;
            case CMD_FAILD:
                u8g2.drawStr(1, 60, "CMD:FAIL");
                break;
            }
        }
        while (u8g2.nextPage());
        // transfer internal memory to the display
//      u8g2.setFont(u8g2_font_open_iconic_all_4x_t);
//      u8g2.drawGlyph(50, 50, i );
//      u8g2.sendBuffer();
        //  wp_open_lock();
        rt_thread_delay(100);
    }

}



static void u8g2_full_buffer_icon_menu(int argc, char *argv[])
{
    general_event = rt_event_create("genera", RT_IPC_FLAG_FIFO);
    tid1 = rt_thread_create("tu8g21",
                            u8g2_icon_menu_entry, RT_NULL,
                            THREAD_STACK_SIZE,
                            THREAD_PRIORITY, THREAD_TIMESLICE);

    /* 如果获得线程控制块，启动这个线程 */
    if (tid1 != RT_NULL)
        rt_thread_startup(tid1);
}
MSH_CMD_EXPORT(u8g2_full_buffer_icon_menu, u8g2 full buffer icon menu sample);

extern "C" void ioco_menu(void);
void ioco_menu()
{
    u8g2_full_buffer_icon_menu(RT_NULL, RT_NULL);
}
